<?php


namespace App\Transformers\System;


use App\Models\SystemConfigTable;
use League\Fractal\TransformerAbstract;

class SystemConfigTableTransformer extends TransformerAbstract
{
    public function transform(SystemConfigTable $systemConfigTable)
    {
        return [
            'id' => $systemConfigTable->id,
            'pid' => $systemConfigTable->pid ?? '',
            'name' => $systemConfigTable->name ?? '',
            'english_name' => $systemConfigTable->english_name ?? '',
            'icon' => $systemConfigTable->icon ?? '',
            'type' => $systemConfigTable->type ?? '',
            'sort' => $systemConfigTable->sort ?? '',
            'status' => $systemConfigTable->status ?? '',
            'created_at' => $systemConfigTable->created_at ? $systemConfigTable->created_at->format("Y-m-d H:i:s") : '',
            'updated_at' => $systemConfigTable->updated_at ? $systemConfigTable->updated_at->format("Y-m-d H:i:s") : '',
        ];
    }
}
